data = FileAttachment("banking_stats.json").json()
measures = data.map(d => d.Measure).filter(function (e, i, x) {return x.indexOf(e, i+1) === -1;});
sectors = data.map(d => d.Sector).filter(function (e, i, x) {return x.indexOf(e, i+1) === -1;});
viewof measure = Inputs.select(measures,
{value: "Total residents assets", label: "Financial Measures", width: 300})
viewof sector = Inputs.select(sectors,
{value: "BIG 4", label: "Banking Sectors", width: 300})
data_filter = data.filter(x => x.Measure==measure).filter(x => x.Sector==sector)
Plot.plot({
color: { legend: true },
y: {
grid: true,
type: "log",
label: "Value: $million"
},
x: { type: "utc" },
marks: [
Plot.ruleY([0]),
Plot.line(data_filter,
{x: "Period", y: "ValueMillion", stroke: "InstitutionSumm" })
]
})
Source: APRA Banking Statistics